/**
 * @author Thomas Pfeiffer
 * @file   CaesarCrypt.h
 * @brief  Implementation of the class Caesar crypt.
 * 
 */
#include "CaesarCrypt.h"

void CaesarCrypt::Encrypt()
{
	unsigned char plain;

	for (size_t i = 0; i < mData.size(); ++i) {
		plain = mData[i];

		mData[i] = (plain + mKey) % NO_CHARS;
	}
}

void CaesarCrypt::Decrypt()
{
	unsigned char caesar;

	for (size_t i = 0; i < mData.size(); ++i) {
		caesar = mData[i];

		mData[i] = (caesar - mKey + NO_CHARS) % NO_CHARS;
	}
}

std::string CaesarCrypt::getFileExtension() const
{
	return ".Caesar";
}
